package org.x.casemodule.enums;

public enum AuditStatus {
    //"DRAFT","PENDING","APPROVED","REJECTED"

    DRAFT("DRAFT","草稿"),
    PENDING("PENDING","待审核"),
    APPROVED("APPROVED","审核通过"),
    REJECTED("REJECTED","审核拒绝");

    private final String value;
    private final String description;

    AuditStatus(String value, String description) {
        this.value = value;
        this.description = description;
    }

    public String getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    public static AuditStatus getByValue(String value) {
        for (AuditStatus status : AuditStatus.values()) {
            if (status.getValue().equals(value)) {
                return status;
            }
        }
        return null;
    }

    public static AuditStatus getByDescription(String description) {
        for (AuditStatus status : AuditStatus.values()) {
            if (status.getDescription().equals(description)) {
                return status;
            }
        }
        return null;
    }


}
